//
//  ZHLineGetHigh.m
//  Doctor
//
//  Created by liuzhishan on 15/12/28.
//  Copyright © 2015年 shanshan. All rights reserved.
//

#import "ZHLineGetHigh.h"
#import "ZHClinicAllData.h"

#define  MYHEIGHT   250.0

@implementation ZHLineGetHigh

+(CGFloat)getHightWithModel:(ZHClinicAllData *)model andIndex:(NSInteger)index
{
    
    ZHSaveClickDate *data = [ZHSaveClickDate shareData];
    ZHSaveCommenMeg *meg = data.judgeModel;

    
    if (meg.max == 0) return MYHEIGHT *HEIPro;
    
    float y = 0;
    
    
    
    if ([meg.judgeName isEqualToString:@"income"]) {
       
        y = (1 - (model.topPrice )/meg.max)*MYHEIGHT*HEIPro ;
        
        if (index == 1) {
            
            y = (1 - (model.money  )/meg.max)*MYHEIGHT*HEIPro ;
        }
        
    }
    
    else
    {
        
        y = (1 - (model.firstVisit )/meg.max)*MYHEIGHT*HEIPro ;
        
        if (index == 1) {
            
            y = (1 - (model.secondVisit  )/meg.max)*MYHEIGHT*HEIPro ;
        }
        
        
        
    }
    
    return y;
    
}

@end
